<%@ page language="java"  contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title><t:mutiLang langKey="common.add.param"/></title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
</head>
<body style="overflow-y: hidden" scroll="no">
<input name="tmpCheckerName" id="tmpCheckerName" type="hidden" value="${mdata.checkerName}">

<t:formvalid formid="formobj" layout="div" dialog="true" action="homeController.do?saveMdata">
	<input name="id" type="hidden" value="${mdata.id }">
	<fieldset class="step">		
	
	    <div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">*</span> 月份: </label> 
			<input class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM'})" style="width: 32%;" id="createMonth"
						       name="createMonth" ignore="ignore" value="${mdata.createMonth  }">
			<span class="Validform_checktip"> 请选择月份 </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">*</span> 所在班组: </label> 
			<select name="bzId" id="bzId" style="width:200px;height:30px;"  onchange="setCheckerName(this.value,'');">
			       <option value="" >请选择</option>
                   <!-- 遍历班组-->			
                   <c:forEach var="team" items="${teamLst }" >                      
		             <option value="${team.bzId }" <c:if test="${team.bzId == mdata.bzId}">selected</c:if>>${team.bzName }</option>
		         </c:forEach>
	        </select>
			<span class="Validform_checktip"> 请选择所在班组 </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">*</span> 用检员: </label> 
			<select name="checkerName" id="checkerName" style="width:200px;height:30px;" value="">
			       <option value="" >请选择</option>
                  
	        </select>
			<span class="Validform_checktip"> 请选择用检员 </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"> <span style="color:red;">*</span> 当月巡检户数: </label> 
			<input name="inspections" class="inputxt"  style="width:200px;"  value="${mdata.inspections }"  datatype="n"> 
			<span class="Validform_checktip"> 请填写当月巡检户数 </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">*</span> 计划巡检户数: </label> 
			<input name="planInspections" class="inputxt"  style="width:200px;"  value="${mdata.planInspections }" datatype="n" >
		    <span class="Validform_checktip"> 请填写计划巡检户数 </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">*</span> 已参与电力保障次数: </label> 
			<input name="powerGuarants" class="inputxt"  style="width:200px;"  value="${mdata.powerGuarants }" datatype="n" >
		    <span class="Validform_checktip"> 请填写已参与电力保障次数 </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">*</span> 当月应急抢修次数: </label> 
			<input name="emergencyRepairs" class="inputxt"  style="width:200px;"  value="${mdata.emergencyRepairs }" datatype="n" >
		    <span class="Validform_checktip"> 请填写当月应急抢修/故障处理次数 </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">&nbsp;</span> 阶段性重点工作: </label> 
			<textarea style="height:50px;width:100%;border:0px;" name="keyWork" maxlength="128">${mdata.keyWork }</textarea>
		    <span class="Validform_checktip"> &nbsp; </span>
		</div>
		
		<div class="form">
			<label class="Validform_label" style="width:120px;"><span style="color:red;">*</span> 预结算比例: </label> 
			<input name="settleProportion" class="inputxt"  style="width:200px;"  value="${mdata.settleProportion }"  >(%)
		    <span class="Validform_checktip"> 请填写预结算比例 </span>
		</div>
		
	 
	</fieldset>
</t:formvalid>

<script type="text/javascript">  
    
    $(function() {
        var bzId = $("#bzId").val();
        if(bzId!=''){
        	var checkerName = $("#tmpCheckerName").val(); 
        	setCheckerName(bzId,checkerName.trim())
        }
    });
    
    function setCheckerName(bzId,checkerName){	
    	
		 $.getJSON('homeController.do?getCheckersByBzId&bzId='+bzId, function (data) {  
             if (data.success) {   
            	   $("#checkerName").empty(); 
            	   $("#checkerName").append("<option>请选择</option>"); 
            	   $.each(data.obj,function(n,value) { 
            		   var option = '';
            		   var cName = value.checkerName.trim();
            		   
            		   if(checkerName==cName){    
            			   option = $("<option selected>").val(cName).text(cName); 
            		   }else{
            			   option = $("<option>").val(cName).text(cName); 
            		   }
            		   
                	   $("#checkerName").append(option); 
            	   });
            	  
             } else {  
                 alert('提示', data.msg);  
             }  
         });
	}
    

</script>

</body>
</html>
